package com.waverider.promotion.biz.dao.ibatis;

import java.util.List;

import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;

import com.waverider.promotion.biz.dao.PromotionGoodsAssDAO;
import com.waverider.promotion.domain.PromotionGoodsAssDO;

@SuppressWarnings("unchecked")
public class PromotionGoodsAssDAOImpl extends SqlMapClientDaoSupport implements
		PromotionGoodsAssDAO {

	@Override
	public void insert(PromotionGoodsAssDO promotionGoodsAssDO) {
		this.getSqlMapClientTemplate().insert("promotionGoodsAss.dao.insert",
				promotionGoodsAssDO);
	}

	@Override
	public int update(PromotionGoodsAssDO promotionGoodsAssDO) {
		return this.getSqlMapClientTemplate().update(
				"promotionGoodsAss.dao.update", promotionGoodsAssDO);
	}

	@Override
	public int deleteById(Long id) {
		return this.getSqlMapClientTemplate().delete(
				"promotionGoodsAss.dao.deleteById", id);
	}

	@Override
	public int deleteByShopId(Long id) {
		return this.getSqlMapClientTemplate().delete(
				"promotionGoodsAss.dao.deleteByShopId", id);
	}

	@Override
	public List<PromotionGoodsAssDO> queryByShopId(Long shopId) {
		return this.getSqlMapClientTemplate().queryForList(
				"promotionGoodsAss.dao.queryByShopId", shopId);
	}

	@Override
	public List<PromotionGoodsAssDO> queryByPromotionId(Long promotionId) {
		return this.getSqlMapClientTemplate().queryForList(
				"promotionGoodsAss.dao.queryByPromotionId", promotionId);
	}

}
